package com.wxhandle.cleandemo.application.services;

import java.io.Serializable;

import com.wxhandle.cleandemo.core.services.EditableServcie;

import org.springframework.stereotype.Service;


@Service
public abstract class DomainServiceImpl<T, TKey extends Serializable> extends QueryServiceImpl<T,TKey> implements EditableServcie<T, TKey>  {

    @Override
    public T insert(T entity) {
        return defaultRepository.save(entity);
    }

    @Override
    public T update(T entity) {
        return defaultRepository.save(entity);
    }

    @Override
    public void delete(T entity) {
        defaultRepository.delete(entity);
    }

    @Override
    public void deleteById(TKey val) {
        defaultRepository.deleteById(val);
    }
    
}
